home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel 68k / lib_test / test_fixed_array1.e < prev    next >
Encoding:
Text File  |  1996-06-13  |  930 b   |  54 lines  |  [TEXT/EDIT]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_FIXED_ARRAY1
  5.  
  6. creation make
  7.    
  8. feature
  9.    
  10.    fai: FIXED_ARRAY[INTEGER];
  11.    
  12.    make is
  13.       local
  14.      i: INTEGER;
  15.       do
  16.      !!fai.make(3);
  17.      is_true(fai.count = 3);
  18.      is_true(fai.upper = 2);
  19.      is_true(fai.lower = 0);
  20.      from
  21.         i := fai.upper;
  22.      until
  23.         i < 0
  24.      loop
  25.         is_true(fai.item(i) = 0);
  26.         fai.put(i,i);
  27.         i := i - 1;
  28.      end;
  29.      from
  30.         i := fai.upper;
  31.      until
  32.         i < 0
  33.      loop
  34.         is_true(fai.item(i) = i);
  35.         i := i - 1;
  36.      end;
  37.       end;
  38.    
  39.    is_true(bool: BOOLEAN) is
  40.       do
  41.      cpt := cpt + 1;
  42.      if not bool then
  43.         std_output.put_string("TEST_FIXED_ARRAY1: ERROR Test # ");
  44.         std_output.put_integer(cpt);
  45.         std_output.put_string("%N");
  46.      else
  47.         -- std_output.put_string("Yes%N");
  48.      end;
  49.       end;
  50.    
  51.    cpt: INTEGER;
  52.    
  53. end -- TEST_FIXED_ARRAY1
  54.